//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Vml
{
    class CoreAttributes
    {
        private string _print; //\\bool

        public string Print
        {
            get { return _print; }
            set { _print = value; }
        }

        private string _wrapcoords;

        public string WrapCoords
        {
            get { return _wrapcoords; }
            set { _wrapcoords = value; }
        }

        private string _coordorigin;

        public string CoordOrigin
        {
            get { return _coordorigin; }
            set { _coordorigin = value; }
        }

        private string _coordsize;

        public string CoordSize
        {
            get { return _coordsize; }
            set { _coordsize = value; }
        }

        private string _alt;

        public string Alt
        {
            get { return _alt; }
            set { _alt = value; }
        }

        private string _title;

        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        private string _class;

        public string Class
        {
            get { return _class; }
            set { _class = value; }
        }

        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }
        private Style _style;

        public Style Style
        {
            get { return _style; }
            set { _style = value; }
        }
        private string _href;

        public string HRef
        {
            get { return _href; }
            set { _href = value; }
        }

        #region IOfficeXmlSerializable Members

        public void ReadXml(ReadContext c)
        {
            Id = c.GetOptionalString("id");
            Style = Style.Parse(c.GetOptionalString("style"));
            HRef = c.GetOptionalString("href");
            Class = c.GetOptionalString("class");
            Title = c.GetOptionalString("title");
            Alt = c.GetOptionalString("alt");
            CoordSize = c.GetOptionalString("coordsize");
            CoordOrigin = c.GetOptionalString("coordorigin");
            WrapCoords = c.GetOptionalString("wrapcoords");
            Print = c.GetOptionalString("print");

        }

        public void WriteXml(WriteContext c)
        {
            c.SetOptionalString("id", Id);
            if (Style != null)
                c.SetOptionalString("style", Style.ToString());
            c.SetOptionalString("href", HRef);
            c.SetOptionalString("class", Class);
            c.SetOptionalString("title", Title);
            c.SetOptionalString("alt", Alt);
            c.SetOptionalString("coordsize", CoordSize);
            c.SetOptionalString("coordorigin", CoordOrigin);
            c.SetOptionalString("wrapcoords", WrapCoords);
            c.SetOptionalString("print", Print);
        }

        #endregion
    }
}
